<html>
<head><meta charset="utf-8"><title>Disallow keywords as macro arguments names lang-team#68 · t-lang/major changes · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/index.html">t-lang/major changes</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Disallow.20keywords.20as.20macro.20arguments.20names.20lang-team.2368.html">Disallow keywords as macro arguments names lang-team#68</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="216041858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Disallow%20keywords%20as%20macro%20arguments%20names%20lang-team%2368/near/216041858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> triagebot <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Disallow.20keywords.20as.20macro.20arguments.20names.20lang-team.2368.html#216041858">(Nov 09 2020 at 03:54)</a>:</h4>
<p><span class="user-group-mention" data-user-group-id="1977">@T-lang</span>: Proposal <a href="https://github.com/rust-lang/lang-team/issues/68#issuecomment-723738912">#68</a> has been seconded, and will be approved in 10 days if no objections are raised.</p>



<a name="216043208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Disallow%20keywords%20as%20macro%20arguments%20names%20lang-team%2368/near/216043208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Disallow.20keywords.20as.20macro.20arguments.20names.20lang-team.2368.html#216043208">(Nov 09 2020 at 04:32)</a>:</h4>
<p>I would be pretty frustrated by this change <a href="#narrow/stream/213817-t-lang/topic/postfix.20macros/near/216043053">https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/postfix.20macros/near/216043053</a></p>



<a name="216043241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Disallow%20keywords%20as%20macro%20arguments%20names%20lang-team%2368/near/216043241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Disallow.20keywords.20as.20macro.20arguments.20names.20lang-team.2368.html#216043241">(Nov 09 2020 at 04:32)</a>:</h4>
<p>can someone explain what benefit it gives? it seems like a pretty high imposition on the user not to use <code>$self</code></p>



<a name="216043323"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Disallow%20keywords%20as%20macro%20arguments%20names%20lang-team%2368/near/216043323" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Disallow.20keywords.20as.20macro.20arguments.20names.20lang-team.2368.html#216043323">(Nov 09 2020 at 04:34)</a>:</h4>
<p>ok I read the linked RFCs and now I'm even more opposed - <code>$self</code> should not silently change meanings</p>



<a name="216043325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Disallow%20keywords%20as%20macro%20arguments%20names%20lang-team%2368/near/216043325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Disallow.20keywords.20as.20macro.20arguments.20names.20lang-team.2368.html#216043325">(Nov 09 2020 at 04:34)</a>:</h4>
<p>the error messages would be awful</p>



<a name="216049832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Disallow%20keywords%20as%20macro%20arguments%20names%20lang-team%2368/near/216049832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kennytm <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Disallow.20keywords.20as.20macro.20arguments.20names.20lang-team.2368.html#216049832">(Nov 09 2020 at 07:19)</a>:</h4>
<p>&lt;<a href="https://sourcegraph.com/search?q=%5C%24%5BsS%5Delf%5Cb+repogroup:crates&amp;patternType=regexp">https://sourcegraph.com/search?q=%5C%24%5BsS%5Delf%5Cb+repogroup:crates&amp;patternType=regexp</a>&gt; at least 131 uses of <code>$self</code>. this change would be too impactful to be done in one edition.</p>



<a name="216051318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Disallow%20keywords%20as%20macro%20arguments%20names%20lang-team%2368/near/216051318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Disallow.20keywords.20as.20macro.20arguments.20names.20lang-team.2368.html#216051318">(Nov 09 2020 at 07:49)</a>:</h4>
<p>Just added a clarifying edit to a comment: <a href="https://github.com/rust-lang/lang-team/issues/68#issuecomment-723738459">https://github.com/rust-lang/lang-team/issues/68#issuecomment-723738459</a></p>



<a name="216051336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Disallow%20keywords%20as%20macro%20arguments%20names%20lang-team%2368/near/216051336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Disallow.20keywords.20as.20macro.20arguments.20names.20lang-team.2368.html#216051336">(Nov 09 2020 at 07:49)</a>:</h4>
<p>I'm agreeing in principle that this seems like a good idea and is worth pursuing, in the spirit of the MCP process, but I still expect that this will go through a crater run and similar to gauge impact.</p>



<a name="216093609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Disallow%20keywords%20as%20macro%20arguments%20names%20lang-team%2368/near/216093609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Disallow.20keywords.20as.20macro.20arguments.20names.20lang-team.2368.html#216093609">(Nov 09 2020 at 14:48)</a>:</h4>
<p>Is the expectation that one could do <code>$r#self</code> for backwards compatibility purposes?</p>



<a name="216093634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Disallow%20keywords%20as%20macro%20arguments%20names%20lang-team%2368/near/216093634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Disallow.20keywords.20as.20macro.20arguments.20names.20lang-team.2368.html#216093634">(Nov 09 2020 at 14:49)</a>:</h4>
<p>(Does that work today?)</p>



<a name="216113972"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Disallow%20keywords%20as%20macro%20arguments%20names%20lang-team%2368/near/216113972" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Ronald Altman <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Disallow.20keywords.20as.20macro.20arguments.20names.20lang-team.2368.html#216113972">(Nov 09 2020 at 17:07)</a>:</h4>
<p>It does work today; that was established above.</p>



<a name="216129407"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Disallow%20keywords%20as%20macro%20arguments%20names%20lang-team%2368/near/216129407" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Disallow.20keywords.20as.20macro.20arguments.20names.20lang-team.2368.html#216129407">(Nov 09 2020 at 19:04)</a>:</h4>
<p>(As an aside, I'm going to be changing the postfix RFC to not use <code>$self</code>, but there's still value in using it as a scope like <code>$crate</code>.)</p>



<a name="216295841"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Disallow%20keywords%20as%20macro%20arguments%20names%20lang-team%2368/near/216295841" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Disallow.20keywords.20as.20macro.20arguments.20names.20lang-team.2368.html#216295841">(Nov 11 2020 at 00:58)</a>:</h4>
<p>From the issue:</p>
<blockquote>
<p>Maybe we want to use a different syntax for things like $crate, that are not naming bindings but instead a "special path"</p>
</blockquote>
<p>That's not obvious to me, because outside of macros we don't do that either.  There's no marker that <code>super</code> is a "special path" instead of a crate.</p>
<p>(Now, maybe we'll decide that it's worth it, either because macros are special or as a concession to back-compat, but using the same syntactic space isn't all that surprising to me.)</p>



<a name="216368407"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Disallow%20keywords%20as%20macro%20arguments%20names%20lang-team%2368/near/216368407" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Disallow.20keywords.20as.20macro.20arguments.20names.20lang-team.2368.html#216368407">(Nov 11 2020 at 16:35)</a>:</h4>
<p><span class="user-mention" data-user-id="125270">@scottmcm</span> Fair point. That occurred to me as well, that we share the same space outside of macros.</p>



<a name="216368476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Disallow%20keywords%20as%20macro%20arguments%20names%20lang-team%2368/near/216368476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Disallow.20keywords.20as.20macro.20arguments.20names.20lang-team.2368.html#216368476">(Nov 11 2020 at 16:36)</a>:</h4>
<p>On the other hand, outside of macros we have more context to help with parsing, which lets us do things like contextual keywords.</p>



<a name="216368490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Disallow%20keywords%20as%20macro%20arguments%20names%20lang-team%2368/near/216368490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Disallow.20keywords.20as.20macro.20arguments.20names.20lang-team.2368.html#216368490">(Nov 11 2020 at 16:36)</a>:</h4>
<p>Inside of macros we don't have that kind of context.</p>



<a name="216368515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/243200-t-lang/major%20changes/topic/Disallow%20keywords%20as%20macro%20arguments%20names%20lang-team%2368/near/216368515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/243200-t-lang/major-changes/topic/Disallow.20keywords.20as.20macro.20arguments.20names.20lang-team.2368.html#216368515">(Nov 11 2020 at 16:36)</a>:</h4>
<p>So something is either a keyword or it isn't.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>